package Domd2;

public class Computer {
    public void openCompurer(){
        System.out.println("打开笔记本");
    }
    public void closeComputer(){
        System.out.println("关闭笔记本");
    }
    public void useComputerUsb(USB usb){
        usb.opneDervice();
        if(usb instanceof Mouse){
            Mouse mouse=(Mouse) usb;
            mouse.click();
        }else if(usb instanceof KeyBorad){
            KeyBorad keyBorad=(KeyBorad) usb;
            keyBorad.input();
        }
        usb.closeDervice();
    }
}
